#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"

# Chemin pour trouver les differents fichers
set var_config_cheminAbsolu [info script] 
set var_config_cheminAbsolu [file dirname $var_config_cheminAbsolu] 

# Inclusion des differents fichiers
source [file join $var_config_cheminAbsolu core gestion voisins.tcl]
source [file join $var_config_cheminAbsolu core salons salons.tcl]
source [file join $var_config_cheminAbsolu core salons gestionSalons.tcl]
source [file join $var_config_cheminAbsolu core messages messages.tcl]
source [file join $var_config_cheminAbsolu core messages retransmissions.tcl]
source [file join $var_config_cheminAbsolu com stdin_stdout builder.tcl]
source [file join $var_config_cheminAbsolu com stdin_stdout parser.tcl]
source [file join $var_config_cheminAbsolu com stdin_stdout envoi.tcl]
source [file join $var_config_cheminAbsolu com stdin_stdout reception.tcl]

source [file join $var_config_cheminAbsolu instance noeuds.tcl]
source [file join $var_config_cheminAbsolu instance voisins.tcl]
source [file join $var_config_cheminAbsolu instance infosPersonnelles.tcl]
source [file join $var_config_cheminAbsolu instance salons.tcl]
source [file join $var_config_cheminAbsolu instance messages.tcl]
source [file join $var_config_cheminAbsolu instance horloge.tcl]

source [file join $var_config_cheminAbsolu com stdin_stdout configuration.tcl]

# Definition des informations personnelles
proc_setMonId [lindex $argv 0]
proc_setMonPseudo "pseudo"

# On s'ajoute a la liste des noeuds que l'on connait
proc_ajouterNoeud [proc_getMonId]

# Au demarrage no ne parle dans aucun salon
proc_setSalonCourantId -1

# Initialisation des differents ping
proc_initPing
proc_initPingSalon

# Interface graphique a utiliser
set var_interface "tile"
source [file join $var_config_cheminAbsolu interface $var_interface frontend.tcl] 
proc_initFrontend $argv







 









